<?php

use Tracy\Debugger;
use flight\debug\tracy\TracyExtensionLoader;

require __DIR__ . '/../vendor/autoload.php';

Debugger::enable();
Debugger::$logDirectory = __DIR__ . '/../runtime/log';
Debugger::$strictMode = true;

// 这连接了点
if (Debugger::$showBar === true) {
    // 这需要为 false，否则 Tracy 不能实际渲染 :(
    Flight::set('flight.content_length', false);
    new TracyExtensionLoader(Flight::app());
}

Flight::set('flight.log_errors', true);

Flight::route('GET /', 'app\controllers\Home->index')->addMiddleware(function() {
  echo 'Middleware first!';
});

echo $a;

Flight::start();
